simstekfandomcom-20200214-history
DBPF
The database-packed file (DBPF) is a format used to store data for pretty much all Maxis games after The Sims, including The Sims Online (the first appearance of this format), SimCity 4, The Sims 2, Spore, MySims, The Sims 3, SimCity 2013, and The Sims 4. Version occurrence Header * Magic number - A 4-byte string (not null-terminated), consisting of the ASCII characters "DBPF" * Major version - A 4-byte unsigned integer specifying the DBPF major version number * Minor version - A 4-byte unsigned integer specifying the DBPF minor version number * Reserved - Unknown 12 bytes set to 0 * Date created (1.0 only) - A 4-byte Unix timestamp specifying when the archive was created * Date modified (1.0 only) - A 4-byte Unix timestamp specifying when the archive was last modified * Index major version (<2.0 only) - A 4-byte unsigned integer specifying the major version of the index format used in the archive * Index entry count - A 4-byte unsigned integer specifying the number of entries contained in the index * Index offset (<2.0 only) - A 4-byte unsigned integer specifying the offset from the beginning of the archive to the first entry of the index * Index size - A 4-byte unsigned integer specifying the size in bytes of the index * Trash Index entry count (<2.0 only) - A 4-byte unsigned integer specifying the number of trash entries in the Trash Index of the archive * Trash Index offset (<2.0 only) - A 4-byte unsigned integer specifying the offset from the beginning of the archive to the first entry of the Trash Index; should be 0 if there is no Trash Index * Trash Index size (<2.0 only) - A 4-byte unsigned integer specifying the size in bytes of the Trash Index * Index Minor Version (<2.0 only) - A 4-byte unsigned integer specifying the minor version of the index format used in the archive * Index Offset (2.0 only) - 4-byte unsigned integer * Unknown (2.0 only) - 4-byte unsigned integer * Reserved - 32 bytes of padding are traditionally used here Index There are three types of DBPF indexes: the regular index, the Trash Index, and the DIR Index. All indexes follow the same format as defined by the index version specified in the header. Entry structure * Type ID - A 4-byte integer describing what type of file is held * Group ID - A 4-byte integer identifying what resource group the file belongs to * Instance ID - A 4-byte ID assigned to the file which, together with the Type ID and the second instance ID (if applicable), is assumed to be unique all throughout the game * Second instance ID (Index >=7.1 only) - A 4-byte integer specifying the high-order Instance ID of the entry * File offset - A 4-byte unsigned integer specifying the offset to the entry's data from the beginning of the archive * File size - A 4-byte unsigned integer specifying the size of the entry's data Regular Index The regular index contains all regular files in the archive. It is made up of a successive series of entries, as many as defined by the Index entry count parameter in the archive's header. Trash Index The Trash Index may be used in all DBPF archive versions before 2.0. The Trash Index contains the list of all files marked deleted in the archive. It is made up of a successive series of entries, as many as defined by the Trash Index entry count parameter in the archive's header. DIR Index All DBPF archives that use compression against their entry data make use of an additional DIR Index, which is itself stored as an entry inside the regular index of the archive under the Type ID 0xE86B1EEF. The DIR Index duplicates all the entries found in both the regular index and the trash index but specifies the decompressed file size of each entry for the File size parameter, rather than compressed.